find_package(Python3 COMPONENTS Development)

if (Python3_FOUND)
  message(STATUS "Python3 found, enable py_scripting")
  project(py_script)
  file(GLOB_RECURSE MODULE_SRCS *.*)

  add_library(${PROJECT_NAME} MODULE ${MODULE_SRCS})
  target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

  # add self extra link libraries
  target_link_libraries(${PROJECT_NAME} PRIVATE pybind11::headers Python3::Python)
  # add self extra include directories
  # target_include_directories(${PROJECT_NAME} PRIVATE )

  AddScriptModule(${PROJECT_NAME} "python" "py" "python language support" ON)
else()
  message(STATUS "Python3 not found, disable py_scripting")
endif()
